home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / TEMP / GNU / flex / Uservariab < prev    next >
Text File  |  1995-06-28  |  3KB  |  70 lines

  1. User variables
  2. Previous: <Miscellaneous=>Miscellane> * Next: <YACC interface=>YACCinterf> * Up: <Top=>!Root>
  3.  
  4. #Wrap on
  5. {fH3}Values available to the user{f}
  6.  
  7. This section summarizes the various values available to
  8. the user in the rule actions.
  9.  
  10. #Indent +4
  11.  
  12.  - {fEmphasis}char \*yytext{f} holds the text of the current token.
  13. It may be modified but not lengthened (you cannot
  14. append characters to the end).
  15.  
  16. If the special directive {fEmphasis}%array{f} appears in the
  17. first section of the scanner description, then
  18. {fCode}yytext{f} is instead declared {fEmphasis}char yytext[YYLMAX]{f},
  19. where {fCode}YYLMAX{f} is a macro definition that you can
  20. redefine in the first section if you don't like the
  21. default value (generally 8KB).  Using {fEmphasis}%array{f}
  22. results in somewhat slower scanners, but the value
  23. of {fCode}yytext{f} becomes immune to calls to {fEmphasis}input(){f} and
  24. {fEmphasis}unput(){f}, which potentially destroy its value when
  25. {fCode}yytext{f} is a character pointer.  The opposite of
  26. {fEmphasis}%array{f} is {fEmphasis}%pointer{f}, which is the default.
  27.  
  28. You cannot use {fEmphasis}%array{f} when generating C++ scanner
  29. classes (the {fEmphasis}-+{f} flag).
  30.  
  31.  
  32.  - {fEmphasis}int yyleng{f} holds the length of the current token.
  33.  
  34.  
  35.  - {fEmphasis}FILE \*yyin{f} is the file which by default {fCode}flex{f} reads
  36. from.  It may be redefined but doing so only makes
  37. sense before scanning begins or after an EOF has
  38. been encountered.  Changing it in the midst of
  39. scanning will have unexpected results since {fCode}flex{f}
  40. buffers its input; use {fEmphasis}yyrestart(){f} instead.  Once
  41. scanning terminates because an end-of-file has been
  42. seen, you can assign {fCode}yyin{f} at the new input file and
  43. then call the scanner again to continue scanning.
  44.  
  45.  
  46.  - {fEmphasis}void yyrestart( FILE \*new\_file ){f} may be called to
  47. point {fCode}yyin{f} at the new input file.  The switch-over
  48. to the new file is immediate (any previously
  49. buffered-up input is lost).  Note that calling
  50. {fEmphasis}yyrestart(){f} with {fCode}yyin{f} as an argument thus throws
  51. away the current input buffer and continues
  52. scanning the same input file.
  53.  
  54.  
  55.  - {fEmphasis}FILE \*yyout{f} is the file to which {fEmphasis}ECHO{f} actions are
  56. done.  It can be reassigned by the user.
  57.  
  58.  
  59.  - {fCode}YY\_CURRENT\_BUFFER{f} returns a {fCode}YY\_BUFFER\_STATE{f} handle
  60. to the current buffer.
  61.  
  62.  
  63.  - {fCode}YY\_START{f} returns an integer value corresponding to
  64. the current start condition.  You can subsequently
  65. use this value with {fCode}BEGIN{f} to return to that start
  66. condition.
  67.  
  68. #Indent
  69.  
  70.